<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        console.log('9:' + isSu(9));
        console.log('7:' + isSu(7));


        function isSu(num){
            let avg = Math.sqrt(num);
            for (let i = 2; i <= avg; i++){
                if (num % i == 0) return false;
            }
            return true;
        }

    </script>
</body>
</html>